#!/bin/sh
set -e
if [ "$DOCKER_IP" ];
    then
    cp /etc/hosts /etc/hosts.temp
    sed -i "s/.*$(hostname)/$DOCKER_IP $(hostname)/" /etc/hosts.temp
    cat /etc/hosts.temp > /etc/hosts
fi
exec /usr/local/tomcat/bin/catalina.sh run